package cn.com.homeyoda.aimate.aihealth.ui.game;

import android.app.Application;

import androidx.annotation.NonNull;

import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.base.BaseViewModel;
import cn.com.homeyoda.aimate.aihealth.data.Repository;
import com.wzq.mvvmsmart.event.StateLiveData;

import java.util.ArrayList;
import java.util.List;

public class GameViewModel extends BaseViewModel<Repository> {

    public StateLiveData<List<GameBean>> gameData;


    public GameViewModel(@NonNull Application application, Repository model) {
        super(application, model);
        gameData = new StateLiveData<>();
        gameData.setValue(new ArrayList<>());
    }

    public void getGameData() {
        List<GameBean> gameList = new ArrayList<>();
        gameList.add(new GameBean("皮肤病知识问答", R.mipmap.ic_game_circle1));
        gameList.add(new GameBean("饮食知识问答", R.mipmap.ic_game_circle2));
        gameList.add(new GameBean("运动知识问答", R.mipmap.ic_game_circle3));
        gameList.add(new GameBean("身心健康知识问答", R.mipmap.ic_game_circle4));
        gameList.add(new GameBean("身心健康知识问答", R.mipmap.ic_game_circle5));
        gameData.postSuccess();
        gameData.getValue().addAll(gameList);
        gameData.postValueAndSuccess(gameData.getValue());
    }
}
